package com.mademoisellegeek.carrentalsimulation.enums;

import com.mademoisellegeek.carrentalsimulation.enums.SortMethod;
import com.mademoisellegeek.carrentalsimulation.optimisation.NoOptNoAdds;
import com.mademoisellegeek.carrentalsimulation.optimisation.OptDepartureNoAdds;
import com.mademoisellegeek.carrentalsimulation.optimisation.OptArrivalNoAdds;
import com.mademoisellegeek.carrentalsimulation.optimisation.OptDepartureArrivalNoAdds;
import com.mademoisellegeek.carrentalsimulation.optimisation.OptDepartureArrivalWithAdds;
import com.mademoisellegeek.carrentalsimulation.OptimisationData;
import com.mademoisellegeek.carrentalsimulation.Command;
import com.mademoisellegeek.carrentalsimulation.Command;
import com.mademoisellegeek.carrentalsimulation.OptimisationData;

public enum OptimisationType {

    N_NONE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return NoOptNoAdds.run(data, SortMethod.NONE);
}
},
    "IN RANDOM ORDER, NO OPTIMISATION, NO ADDITIONAL JOURNEYS AUTHORISED"),
    N_START_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return NoOptNoAdds.run(data, SortMethod.START_DATE);
}
},
    "SORTED BY START DATE, NO OPTIMISATION, NO ADDITIONAL JOURNEYS AUTHORISED"),
    N_END_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return NoOptNoAdds.run(data, SortMethod.END_DATE);
}
},
    "SORTED BY END DATE, NO OPTIMISATION, NO ADDITIONAL JOURNEYS AUTHORISED"),
    N_LONGEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return NoOptNoAdds.run(data, SortMethod.LONGEST_FIRST);
}
},
    "SORTED LONGEST FIRST, NO OPTIMISATION, NO ADDITIONAL JOURNEYS AUTHORISED"),
    N_SHORTEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return NoOptNoAdds.run(data, SortMethod.SHORTEST_FIRST);
}
},
    "SORTED SHORTEST FIRST, NO OPTIMISATION, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCD_NONE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureNoAdds.run(data, SortMethod.NONE);
}
},
    "IN RANDOM ORDER, BEST CHOICE DEPARTURE, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCD_START_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureNoAdds.run(data, SortMethod.START_DATE);
}
},
    "SORTED BY START DATE, BEST CHOICE DEPARTURE, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCD_END_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureNoAdds.run(data, SortMethod.END_DATE);
}
},
    "SORTED BY END DATE, BEST CHOICE DEPARTURE, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCD_LONGEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureNoAdds.run(data, SortMethod.LONGEST_FIRST);
}
},
    "SORTED LONGEST FIRST, BEST CHOICE DEPARTURE, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCD_SHORTEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureNoAdds.run(data, SortMethod.SHORTEST_FIRST);
}
},
    "SORTED SHORTEST FIRST, BEST CHOICE DEPARTURE, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCA_NONE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptArrivalNoAdds.run(data, SortMethod.NONE);
}
},
    "IN RANDOM ORDER, BEST CHOICE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCA_START_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptArrivalNoAdds.run(data, SortMethod.START_DATE);
}
},
    "SORTED BY START DATE, BEST CHOICE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCA_END_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptArrivalNoAdds.run(data, SortMethod.END_DATE);
}
},
    "SORTED BY END DATE, BEST CHOICE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCA_LONGEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptArrivalNoAdds.run(data, SortMethod.LONGEST_FIRST);
}
},
    "SORTED LONGEST FIRST, BEST CHOICE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCA_SHORTEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptArrivalNoAdds.run(data, SortMethod.SHORTEST_FIRST);
}
},
    "SORTED SHORTEST FIRST, BEST CHOICE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCDA_NONE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalNoAdds.run(data, SortMethod.NONE);
}
},
    "IN RANDOM ORDER, BEST CHOICE DEPARTURE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCDA_START_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalNoAdds.run(data, SortMethod.START_DATE);
}
},
    "SORTED BY START DATE, BEST CHOICE DEPARTURE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCDA_END_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalNoAdds.run(data, SortMethod.END_DATE);
}
},
    "SORTED BY END DATE, BEST CHOICE DEPARTURE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCDA_LONGEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalNoAdds.run(data, SortMethod.LONGEST_FIRST);
}
},
    "SORTED LONGEST FIRST, BEST CHOICE DEPARTURE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCDA_SHORTEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalNoAdds.run(data, SortMethod.SHORTEST_FIRST);
}
},
    "SORTED SHORTEST FIRST, BEST CHOICE DEPARTURE ARRIVAL, NO ADDITIONAL JOURNEYS AUTHORISED"),
    BCDAWITHADDS_NONE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalWithAdds.run(data, SortMethod.NONE);
}
},
    "IN RANDOM ORDER, BEST CHOICE DEPARTURE ARRIVAL, ADDITIONAL JOURNEYS AUTHORISED"),
    BCDAWITHADDS_START_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalWithAdds.run(data, SortMethod.START_DATE);
}
},
    "SORTED BY START DATE, BEST CHOICE DEPARTURE ARRIVAL, ADDITIONAL JOURNEYS AUTHORISED"),
    BCDAWITHADDS_END_DATE(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalWithAdds.run(data, SortMethod.END_DATE);
}
},
    "SORTED BY END DATE, BEST CHOICE DEPARTURE ARRIVAL, ADDITIONAL JOURNEYS AUTHORISED"),
    BCDAWITHADDS_LONGEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalWithAdds.run(data, SortMethod.LONGEST_FIRST);
}
},
    "SORTED LONGEST FIRST, BEST CHOICE DEPARTURE ARRIVAL, ADDITIONAL JOURNEYS AUTHORISED"),
    BCDAWITHADDS_SHORTEST_FIRST(new Command() {

@Override
public int[] invoke(OptimisationData data) {
    return OptDepartureArrivalWithAdds.run(data, SortMethod.SHORTEST_FIRST);
}
},
    "SORTED SHORTEST FIRST, BEST CHOICE DEPARTURE ARRIVAL, ADDITIONAL JOURNEYS AUTHORISED");
    
    
    
    private final Command command;
    private final String description;

    OptimisationType(Command command, String description) {
        this.command = command;
        this.description = description;
    }

    public int[] run(OptimisationData data) {
        return this.command.invoke(data);
    }

    public void printDescription() {
        System.out.println(this.description);
    }
}